package com.hkbigdata.transform;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author liuanbo
 * @creat 2024-04-11-15:51
 * @see 2194550857@qq.com
 */
public class Flink07_TransForm_Union_Anonymous {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        DataStreamSource<Integer> integerDataStreamSource = env.fromElements(1, 2, 3, 4, 5, 6);
        DataStreamSource<Integer> integerDataStreamSource1 = env.fromElements(1, 2, 5, 4);
        DataStreamSource<Integer> integerDataStreamSource2 = env.fromElements(1, 2, 6, 4, 5, 6);

        DataStream<Integer> union =
                integerDataStreamSource.
                        union(integerDataStreamSource1)
                        .union(integerDataStreamSource2);
        union.print();

        env.execute();


    }
}
